<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title></title>
    <%@ include file="/WEB-INF/include/common.jsp"%>
    <%@ include file="/WEB-INF/include/commoncss.jsp"%>

</head>
<body>
<div class="page-container">
    <input type="file" id="input_file" name="input_file"/><button onclick="upload_excel(this.value)" type="button" class="btn btn-success radius" value="${country_code}">上传</button>
</div>
<%@ include file="/WEB-INF/include/commonjs.jsp"%>
<script type="text/javascript">
    function upload_excel(value){
        var f=document.getElementById("input_file");
        var formData=new FormData();
        formData.append("file",f.files[0]);
        formData.append("country_code",value);
        $.ajax({
            type:"post",
            data:formData,
            url:"${ctx }/BaseInformation/uploadStatistics.do",
            async:false,
            xhrFields: {
                withCredentials: true
            },
            cache: false,
            contentType: false,
            processData: false,
            scriptCharset: 'utf-8',
            success:function (data) {
                alert(data);
            },
            error:function (data) {
                alert("服务器处理失败！");
            }
        })
    }
</script>

</body>
</html>